package spring.model.service;

import spring.domain.Operand;

//Business Service 클래스 - 사칙연산 메소드들 제공
public class CalculatorService {

	public int plus(int o1, int o2){
		return o1+o2;
	}
	public int minus(Operand oto){
		return oto.getOperand1()-oto.getOperand2();
	}
	public int multiply(Operand oto){
		return oto.getOperand1()*oto.getOperand2();
	}
	public int divide(int o1, int o2) throws Exception{
		if(o2==0){
			throw new Exception("0으로는 어떤 수도 못나눕니다.");
		}
		return o1/o2;
	}
}








